package com.neutech.maplestory.entity;

import com.neutech.maplestory.client.MapleStoryClient;
import com.neutech.maplestory.util.ImageUtil;

import java.awt.*;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;

/**
 * @author ZZQ
 * @PackageName: com.neutech.maplestory.entity
 * @ClassName: ItemPackage
 * @Description:
 * @date 2021/1/30 10:17
 */
public class ItemPackage extends AbstractMapleStoryObject{

    public List<Item> items = new CopyOnWriteArrayList<>();
    public Image img;
    public ItemPackage (){
        this.x = 1000;
        this.y = 200;
    }
    public ItemPackage (MapleStoryClient msc){
        this();
        this.msc = msc;
        this.img = ImageUtil.getImage("itemPackage");
        this.live = false;
    }
    @Override
    public void draw(Graphics g) {
        if (live){
            g.drawImage(img,x - 10,y,null);
            for (int i = 0;i < items.size();i ++){
                Item item =items.get(i);
                g.drawImage(item.img,x + (i * 37),y + 53,null);
                g.drawString(item.qty+"",x + (i * 35),y + 75);
            }
        }

    }
}


